<?php
/**
 * Created by PhpStorm.
 * User: 跳梁
 * Date: 2016/3/4
 * Time: 11:17
 */
class settlementModule extends Module{
    function __construct() {
        $this->includePhp("settlement","settlement");
    }
    public function call($user,$method,$param){
        switch($method){
            case 'login':
                $loginName = $param->loginName;
                $password = $param->password;
                if(!isset($loginName)||!isset($password)){
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                settlement::login($loginName,$password);
                break;
            case 'accountList':
                $id = $param->id;
                $agent = $param->agent;
                $type = $param->type;
                $start = $param->start;
                $limit = $param->limit;
                if(!isset($id)||!isset($agent)||!isset($type)){
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                settlement::accountList($id,$agent,$type,$start,$limit);
                break;
            case 'index':
                settlement::index();
                break;
            case 'saveCash':
                $id = $param->id;
                $cash = $param->cash;
                $agent = $param->agent;
                $cuid = $param->cuid;
                if(!isset($id)||!isset($cash)||!isset($agent)||!isset($cuid)){
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                settlement::saveCash($id,$cash,$agent,$cuid);
                break;
        }
    }

}
$module = new settlementModule();
Module::addModule($module);
?>